﻿using System;
namespace Producers.Rr.Xtee.Riik.Ee.Producer.Rr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="RR80Response_v1", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR80ResponseV1))]
    public class RR80ResponseV1Serializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IRR80ResponseV1 clazz;
        
        public RR80ResponseV1Serializer(IRR80ResponseV1 clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("Eesnimi");
            if (clazz.Eesnimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Eesnimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Eesnimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Perenimi");
            if (clazz.Perenimi!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Perenimi))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Perenimi");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Sugu");
            if (clazz.Sugu!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Sugu))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Sugu");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Synniaeg");
            if (clazz.Synniaeg!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Synniaeg))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Synniaeg");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Istaatuskd");
            if (clazz.Istaatuskd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Istaatuskd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Istaatuskd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Istaatus");
            if (clazz.Istaatus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Istaatus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Istaatus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kstaatuskd");
            if (clazz.Kstaatuskd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kstaatuskd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kstaatuskd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kstaatus");
            if (clazz.Kstaatus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kstaatus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kstaatus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Kodakondsus");
            if (clazz.Kodakondsus!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Kodakondsus))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kodakondsus");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("TeovoimeKd");
            if (clazz.TeovoimeKd!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TeovoimeKd))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TeovoimeKd");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Teovoime");
            if (clazz.Teovoime!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Teovoime))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Teovoime");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Veakood");
            Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
            Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.Veakood))).ToString());
            Writer.WriteEndElement();
            Writer.WriteStartElement("Veatekst");
            if (clazz.Veatekst!=null) {
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.Veatekst))).ToString());
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Veatekst");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Elukoht");
            if (clazz.Elukoht!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR80Response_v1>Elukoht>Elukoht", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Elukoht.Count);
                for (int x = 0; ((clazz.Elukoht != null) 
                            && (x < clazz.Elukoht.Count)); x = (x + 1)) {
                    if (clazz.Elukoht[x]!=null) {
                        Writer.WriteStartElement("Elukoht");
                        global::Xtee.Core.SerializationMetadata metaElukoht = this.GetMetaData(clazz.Elukoht[x]);
                        Writer.WriteTypeAttribute(metaElukoht.TypeQualifiedName.Namespace, metaElukoht.TypeQualifiedName.Name);
                        metaElukoht.NewSerializer(clazz.Elukoht[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Elukoht");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("Postiaadress");
            if (clazz.Postiaadress!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>RR80Response_v1>Postiaadress>Postiaadress", "http://producers.rr.xtee.riik.ee/producer/rr", clazz.Postiaadress.Count);
                for (int x = 0; ((clazz.Postiaadress != null) 
                            && (x < clazz.Postiaadress.Count)); x = (x + 1)) {
                    if (clazz.Postiaadress[x]!=null) {
                        Writer.WriteStartElement("Postiaadress");
                        global::Xtee.Core.SerializationMetadata metaPostiaadress = this.GetMetaData(clazz.Postiaadress[x]);
                        Writer.WriteTypeAttribute(metaPostiaadress.TypeQualifiedName.Namespace, metaPostiaadress.TypeQualifiedName.Name);
                        metaPostiaadress.NewSerializer(clazz.Postiaadress[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Postiaadress");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="Eesnimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Eesnimi");
                }
                clazz.Eesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Eesnimi")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Eesnimi", Reader.LocalName);
            }
            if (Reader.LocalName=="Perenimi") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Perenimi");
                }
                clazz.Perenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Perenimi")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Perenimi", Reader.LocalName);
            }
            if (Reader.LocalName=="Sugu") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Sugu");
                }
                clazz.Sugu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Sugu")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Sugu", Reader.LocalName);
            }
            if (Reader.LocalName=="Synniaeg") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Synniaeg");
                }
                clazz.Synniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Synniaeg")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Synniaeg", Reader.LocalName);
            }
            if (Reader.LocalName=="Istaatuskd") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Istaatuskd");
                }
                clazz.Istaatuskd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Istaatuskd")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Istaatuskd", Reader.LocalName);
            }
            if (Reader.LocalName=="Istaatus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Istaatus");
                }
                clazz.Istaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Istaatus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Istaatus", Reader.LocalName);
            }
            if (Reader.LocalName=="Kstaatuskd") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Kstaatuskd");
                }
                clazz.Kstaatuskd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kstaatuskd")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Kstaatuskd", Reader.LocalName);
            }
            if (Reader.LocalName=="Kstaatus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Kstaatus");
                }
                clazz.Kstaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kstaatus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Kstaatus", Reader.LocalName);
            }
            if (Reader.LocalName=="Kodakondsus") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Kodakondsus");
                }
                clazz.Kodakondsus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Kodakondsus")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Kodakondsus", Reader.LocalName);
            }
            if (Reader.LocalName=="TeovoimeKd") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>TeovoimeKd");
                }
                clazz.TeovoimeKd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("TeovoimeKd")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>TeovoimeKd", Reader.LocalName);
            }
            if (Reader.LocalName=="Teovoime") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Teovoime");
                }
                clazz.Teovoime = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Teovoime")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Teovoime", Reader.LocalName);
            }
            if (Reader.LocalName=="Veakood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Veakood");
                }
                clazz.Veakood = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("Veakood")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Veakood", Reader.LocalName);
            }
            if (Reader.LocalName=="Veatekst") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Veatekst");
                }
                clazz.Veatekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Veatekst")).Value;
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Veatekst", Reader.LocalName);
            }
            if (Reader.LocalName=="Elukoht") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Elukoht");
                }
                clazz.Elukoht = new System.Collections.Generic.List<RR80ResponseV1.IElukohtType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Elukoht");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Elukoht")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR80Response_v1>Elukoht>Elukoht");
                        }
                        global::Xtee.Core.SerializationMetadata metaElukoht = this.GetMetaData<RR80ResponseV1.IElukohtType>(Reader, ">>>RR80Response_v1>Elukoht>Elukoht", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR80ResponseV1.IElukohtType item = metaElukoht.NewEntity<RR80ResponseV1.IElukohtType>();
                        clazz.Elukoht.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Elukoht");
                            metaElukoht.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Elukoht", Reader.LocalName);
            }
            if (Reader.LocalName=="Postiaadress") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>RR80Response_v1>Postiaadress");
                }
                clazz.Postiaadress = new System.Collections.Generic.List<RR80ResponseV1.IPostiaadressType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("Postiaadress");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "Postiaadress")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>RR80Response_v1>Postiaadress>Postiaadress");
                        }
                        global::Xtee.Core.SerializationMetadata metaPostiaadress = this.GetMetaData<RR80ResponseV1.IPostiaadressType>(Reader, ">>>RR80Response_v1>Postiaadress>Postiaadress", "http://producers.rr.xtee.riik.ee/producer/rr");
                        RR80ResponseV1.IPostiaadressType item = metaPostiaadress.NewEntity<RR80ResponseV1.IPostiaadressType>();
                        clazz.Postiaadress.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("Postiaadress");
                            metaPostiaadress.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>RR80Response_v1>Postiaadress", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR80Response_v1>Elukoht>Elukoht", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR80ResponseV1.ElukohtType))]
        public class ElukohtTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR80ResponseV1.IElukohtType clazz;
            
            public ElukohtTypeSerializer(RR80ResponseV1.IElukohtType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Elukoht.Riikkd");
                if (clazz.ElukohtRiikkd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtRiikkd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtRiikkd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Maakondkd");
                if (clazz.ElukohtMaakondkd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtMaakondkd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtMaakondkd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Maakond");
                if (clazz.ElukohtMaakond!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtMaakond))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtMaakond");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Linn");
                if (clazz.ElukohtLinn!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtLinn))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtLinn");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Asula");
                if (clazz.ElukohtAsula!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtAsula))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtAsula");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Vkoht");
                if (clazz.ElukohtVkoht!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtVkoht))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtVkoht");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Tanav");
                if (clazz.ElukohtTanav!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtTanav))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtTanav");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Nimi");
                if (clazz.ElukohtNimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtNimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtNimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Maja");
                if (clazz.ElukohtMaja!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtMaja))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtMaja");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Korter");
                if (clazz.ElukohtKorter!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtKorter))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtKorter");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Sihtnumber");
                if (clazz.ElukohtSihtnumber!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtSihtnumber))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtSihtnumber");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Alates");
                if (clazz.ElukohtAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Elukoht.Kuni");
                if (clazz.ElukohtKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ElukohtKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ElukohtKuni");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Elukoht.Riikkd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Riikkd");
                    }
                    clazz.ElukohtRiikkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Riikkd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Riikkd", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Maakondkd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Maakondkd");
                    }
                    clazz.ElukohtMaakondkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Maakondkd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Maakondkd", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Maakond") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Maakond");
                    }
                    clazz.ElukohtMaakond = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Maakond")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Maakond", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Linn") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Linn");
                    }
                    clazz.ElukohtLinn = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Linn")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Linn", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Asula") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Asula");
                    }
                    clazz.ElukohtAsula = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Asula")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Asula", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Vkoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Vkoht");
                    }
                    clazz.ElukohtVkoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Vkoht")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Vkoht", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Tanav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Tanav");
                    }
                    clazz.ElukohtTanav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Tanav")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Tanav", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Nimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Nimi");
                    }
                    clazz.ElukohtNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Nimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Nimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Maja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Maja");
                    }
                    clazz.ElukohtMaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Maja")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Maja", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Korter") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Korter");
                    }
                    clazz.ElukohtKorter = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Korter")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Korter", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Sihtnumber") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Sihtnumber");
                    }
                    clazz.ElukohtSihtnumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Sihtnumber")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Sihtnumber", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Alates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Alates");
                    }
                    clazz.ElukohtAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Alates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Alates", Reader.LocalName);
                }
                if (Reader.LocalName=="Elukoht.Kuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Kuni");
                    }
                    clazz.ElukohtKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Elukoht.Kuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Elukoht>Elukoht>Elukoht.Kuni", Reader.LocalName);
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>RR80Response_v1>Postiaadress>Postiaadress", Namespace="http://producers.rr.xtee.riik.ee/producer/rr", Target=typeof(RR80ResponseV1.PostiaadressType))]
        public class PostiaadressTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected RR80ResponseV1.IPostiaadressType clazz;
            
            public PostiaadressTypeSerializer(RR80ResponseV1.IPostiaadressType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                Writer.WriteStartElement("Postiaadress.Riikkd");
                if (clazz.PostiaadressRiikkd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressRiikkd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressRiikkd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Maakondkd");
                if (clazz.PostiaadressMaakondkd!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressMaakondkd))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressMaakondkd");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Maakond");
                if (clazz.PostiaadressMaakond!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressMaakond))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressMaakond");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Linn");
                if (clazz.PostiaadressLinn!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressLinn))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressLinn");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Asula");
                if (clazz.PostiaadressAsula!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressAsula))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressAsula");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Vkoht");
                if (clazz.PostiaadressVkoht!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressVkoht))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressVkoht");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Tanav");
                if (clazz.PostiaadressTanav!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressTanav))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressTanav");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Nimi");
                if (clazz.PostiaadressNimi!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressNimi))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressNimi");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Maja");
                if (clazz.PostiaadressMaja!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressMaja))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressMaja");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Korter");
                if (clazz.PostiaadressKorter!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressKorter))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressKorter");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Sihtnumber");
                if (clazz.PostiaadressSihtnumber!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressSihtnumber))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressSihtnumber");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Alates");
                if (clazz.PostiaadressAlates!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressAlates))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressAlates");
                }
                Writer.WriteEndElement();
                Writer.WriteStartElement("Postiaadress.Kuni");
                if (clazz.PostiaadressKuni!=null) {
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PostiaadressKuni))).ToString());
                }
                else {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PostiaadressKuni");
                }
                Writer.WriteEndElement();
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="Postiaadress.Riikkd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Riikkd");
                    }
                    clazz.PostiaadressRiikkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Riikkd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Riikkd", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Maakondkd") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Maakondkd");
                    }
                    clazz.PostiaadressMaakondkd = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Maakondkd")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Maakondkd", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Maakond") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Maakond");
                    }
                    clazz.PostiaadressMaakond = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Maakond")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Maakond", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Linn") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Linn");
                    }
                    clazz.PostiaadressLinn = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Linn")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Linn", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Asula") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Asula");
                    }
                    clazz.PostiaadressAsula = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Asula")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Asula", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Vkoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Vkoht");
                    }
                    clazz.PostiaadressVkoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Vkoht")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Vkoht", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Tanav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Tanav");
                    }
                    clazz.PostiaadressTanav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Tanav")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Tanav", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Nimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Nimi");
                    }
                    clazz.PostiaadressNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Nimi")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Nimi", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Maja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Maja");
                    }
                    clazz.PostiaadressMaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Maja")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Maja", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Korter") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Korter");
                    }
                    clazz.PostiaadressKorter = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Korter")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Korter", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Sihtnumber") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Sihtnumber");
                    }
                    clazz.PostiaadressSihtnumber = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Sihtnumber")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Sihtnumber", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Alates") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Alates");
                    }
                    clazz.PostiaadressAlates = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Alates")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Alates", Reader.LocalName);
                }
                if (Reader.LocalName=="Postiaadress.Kuni") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Kuni");
                    }
                    clazz.PostiaadressKuni = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("Postiaadress.Kuni")).Value;
                }
                else {
                    throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>>>RR80Response_v1>Postiaadress>Postiaadress>Postiaadress.Kuni", Reader.LocalName);
                }
            }
        }
    }
}
